<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8">
    <title>v-once</title>
</head>
<body>

    <h3>指令: v-once</h3>

    <div id="root">
        <input type="text" v-model="username">
        <p v-once>{{ username }}</p>
        <p>{{ username }}</p>
    </div>

    <script src="../scripts/vue@3.2.31.js" type="text/javascript"></script>

    <script type="text/javascript">
        const options = {
            data(){
                return {
                    username: 'hello,world'
                }
            }
        }
        
        Vue.createApp(options).mount('#root');
    </script>
    
</body>
</html>